#ifndef MU_MESSAGES_H
#define MU_MESSAGES_H

#pragma once

#include <vector>
#include <string>

static std::string GetErrString(std::vector<std::string> &vec,int err_code)
{
    return vec.at(err_code);
}

/**
 *@details
 * 以下所有列举的项目均为会导致设备硬件中断或者无法使用的问题，是重大异常
 */
namespace MU_EXPS {
    typedef enum EXP_SQL_EXPECTION{
                EXP_SQL_NO_ERROR            = 0,
                EXP_SQL_NAME ,              /// 没有设定名称
                EXP_SQL_PATH ,              /// 路径下不存在这个文件或者路径有问题
                EXP_SQL_FALSE  ,
                EXP_SQL_READ  ,
                EXP_SQL_WRITE  ,
    }SQL_EXPECTION;

    typedef enum EXP_ROBOT_EXPECTION{
                EXP_RBT_NO_ERROR            = 0,
                EXP_RBT_SYSCONF ,
                EXP_RBT_COM     ,
                EXP_RBT_MOVE    ,
                EXP_RBT_CIRCLE  ,
                EXP_RBT_AUTOSTART   ,
                EXP_RBT_GUN,
                EXP_RBT_DIS,
    }ROBOT_EXPECTION;

    typedef enum EXP_IMAGE_EXPECTION{
                EXP_IMAGE_NO_ERROR            = 0,
                EXP_IMAGE_IMAGE_FAIL ,      /// 图像错误
                EXP_IMAGE_PARA_FAIL ,       /// 参数错误
                EXP_IMAGE_FALSE  ,
    }IMAGE_EXPECTION;

    typedef enum EXP_CAMERA_EXPECTION{
                EXP_CAMERA_NO_ERROR            = 0,
                EXP_CAMERA_SYSCONF ,
                EXP_CAMERA_GETBUFFER ,
                EXP_CAMERA_OPEN     ,
                EXP_CAMERA_CLOSE     ,
                EXP_CAMERA_FALSE  ,
                EXP_CAMERA_DIS,
    }CAMERA_EXPECTION;

    typedef enum EXP_LASER_EXPECTION{
                EXP_LASER_NO_ERROR     = 0,
                EXP_LASER_SYSCONF ,
                EXP_LASER_FALSE  ,
                EXP_LASER_DIS,
    }LASER_EXPECTION;

    typedef enum EXP_PLC_EXPECTION{
            EXP_PLC_NO_ERROR     = 0,
            EXP_PLC_SYSCONF ,
            EXP_PLC_AIR  ,
            EXP_PLC_DIS,
    }PLC_EXPECTION;

    typedef enum EXP_APP_EXPECTION{
            EXP_APP_NO_ERROR     = 0,
            EXP_APP_SYSCONF ,
            EXP_APP_OTHERWISE  ,
            EXP_APP_INIT_FALSE,
    }APP_EXPECTION;

}

namespace MU_Messages {
    static std::vector<std::string> Module{"No","相机","PLC","焊丝","日志系统","数据库","预留","变位机","激光","Calc","图像算法","机器人"};
    static std::vector<std::string> Robot{"No error!","找不到配置文件!","通讯异常!","Move异常!","循环模式未开启!","示教器程序错误!","焊枪干涉!","机器人掉线"};
    static std::vector<std::string> SQL{"No error!","没有设定名称!","路径下不存在这个文件或者路径有问题!","SQL超做异常!","SQL读失败!","SQL写失败!"};
    static std::vector<std::string> Image{"No error!","图像错误!","参数错误!","算法调用错误!"};
    static std::vector<std::string> Camera{"No error!","找不到配置文件!","获取图像异常!","相机打开异常!","相机关闭异常!","其他异常!","相机掉线!"};
    static std::vector<std::string> Plc{"No error!","找不到配置文件!","汽阀异常!","断开连接!"};
    static std::vector<std::string> Laser{"No error!","找不到配置文件!","激光异常!","激光断开连接!"};
    static std::vector<std::string> App{"No error!","找不到配置文件!","未知异常!","初始化异常!"};
    static std::vector<std::string> All{"预留","相机","PLC","焊接模块","日志","数据库","预留","变位机","激光","预留","图像算法","机器人"};
}









//the following are UBUNTU/LINUX ONLY terminal color codes.
#define RESET   "\033[0m"
#define BLACK   "\033[30m"      /* Black */
#define RED     "\033[31m"      /* Red */
#define GREEN   "\033[32m"      /* Green */
#define YELLOW  "\033[33m"      /* Yellow */
#define BLUE    "\033[34m"      /* Blue */
#define MAGENTA "\033[35m"      /* Magenta */
#define CYAN    "\033[36m"      /* Cyan */
#define WHITE   "\033[37m"      /* White */
#define BOLDBLACK   "\033[1m\033[30m"      /* Bold Black */
#define BOLDRED     "\033[1m\033[31m"      /* Bold Red */
#define BOLDGREEN   "\033[1m\033[32m"      /* Bold Green */
#define BOLDYELLOW  "\033[1m\033[33m"      /* Bold Yellow */
#define BOLDBLUE    "\033[1m\033[34m"      /* Bold Blue */
#define BOLDMAGENTA "\033[1m\033[35m"      /* Bold Magenta */
#define BOLDCYAN    "\033[1m\033[36m"      /* Bold Cyan */
#define BOLDWHITE   "\033[1m\033[37m"      /* Bold White */


#endif // MU_MESSAGES_H

/**************************************************************************************/

/*
    ** 本模块为功能扩展，用于暂停某一项的任务，当前版本暂时不自持使用
*/


///// 子模块运行表
//typedef enum MU_RUN_LIST{
//        MU_RUN_NONE     = 0b0000,
//        MU_RUN_CAM      = 0x1 << 0,
//        MU_RUN_PLC      = 0x1 << 1,
//        MU_RUN_WELD     = 0x1 << 2,
//        MU_RUN_LOG      = 0x1 << 3,
//        MU_RUN_SQL      = 0x1 << 4,
//        MU_RUN_IO       = 0x1 << 5,
//        MU_RUN_MACHINE  = 0x1 << 6,
//        MU_RUN_LASYER   = 0x1 << 7,
//        MU_RUN_CALC     = 0x1 << 8,
//        MU_RUN_IMAGE    = 0x1 << 9,
//        MU_RUN_ROBOT    = 0x1 << 10,
//        MU_RUN_ALL      = 0xff,
//}MU_R_LIST;



/// 当前的暂停可以**
//typedef enum MU_PAUSE_LIST{
//            MU_PAUSE_NONE           = 0b0000,
//            MU_PAUSE_PLC            = 0b0001,
//            MU_PAUSE_CAM            = 0b0010,
//            MU_PAUSE_ROBOT          = 0b0100,
//            MU_PAUSE_LASYER         = 0b1000,
//            MU_PAUSE_WELD           = 0b10000,
//            MU_PAUSE_MACHINE        = 0b100000,
//}MU_P_LIST;

/**************************************************************************************/
